<?php

	$moduleRequest = "";

	if (isset($_REQUEST['param']))
		$moduleRequest = $_REQUEST['param'];


	$pageHTML = getListenPage('http://download.finance.yahoo.com/d/quotes.csv?s='.$moduleRequest.'&f=sl1d1t1c1ohgv&e=.csv' );

	$contents = explode( ',', str_replace( '"', '', $pageHTML ) );


	echo "$contents[1]";

	function getListenPage($fvsWebUrl)
	{

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL,$fvsWebUrl);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($ch, CURLOPT_TIMEOUT, 60);
		$ret = curl_exec ($ch);
		curl_close($ch);

		return $ret;
	}
?> 
